package com.hyx.java.base;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;

/**
 * 分页工具类
 */
@Getter
@Setter
public class PageBean<T> {

    @ApiModelProperty("当前页码")
    private Integer curPage;
    @ApiModelProperty("每页数量")
    private Integer pageSize;
    @ApiModelProperty("总页数")
    private Long pages;
    @ApiModelProperty("总条数")
    private Long total;
    @ApiModelProperty("当前页数据")
    private List<T> records;

    public PageBean(Integer curPage, Integer pageSize) {
        this.curPage = curPage == null ? 1 : curPage;
        this.pageSize = pageSize == null ? 10 : pageSize;
    }
}
